<template>
  <div class="container">
    <router-link v-for="(item, index) in list" :key="index" :to="item.path" tag="span" active-class="act">{{item.name}}</router-link>
  </div>
</template>

<script>
export default {
  name: 'routerList',
  data() {
    return {
      title: 'routerList',
      list:[]
    }
  },
  methods: {
    routerChange() {
      console.log(this.$route)
    }
  },
  mounted() {
    this.list = this.$router.options.routes
  }
}
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  span { 
    margin: 0 10px;
  }
  .act {
    color: blueviolet;
  }
}
</style>